package com.hedy.user.controller;

import com.hedy.user.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "user")
public class DemoController {
    @Autowired
    DemoService demoService;

    @GetMapping(value = "demo01")
    public String demo1(Integer a, Integer b, Integer c, Integer d) {
        if (a > b && c > d) {
            return demoService.greater(a, b, c, d);
        } else if (a > b || c > d) {
            return demoService.greaterOne(a, b, c, d);
        } else if (a < b && c < d) {
            return demoService.less(a, b, c, d);
        } else {
            return demoService.equal(a, b, c, d);
        }
    }
}

